<?php

use Drupal\shusy_anchor\Entity\ShusyAnchor;
use Drupal\ssy_live_room\Entity\SsyLiveRoom;

function ssy_live_room_ssy_live_room_add_page() {
  $e = new SsyLiveRoom();
  module_load_include('inc', 'ssy_live_room', 'ssy_live_room.forms');
  return drupal_get_form('ssy_live_room_ssy_live_room_entity_form', $e, 'add');
}

function ssy_live_room_ssy_live_room_view_page(SsyLiveRoom $e) {
  return entity_view($e->entityType(), [$e]);
}

function ssy_live_room_ssy_live_room_edit_page(SsyLiveRoom $e) {
  module_load_include('inc', 'ssy_live_room', 'ssy_live_room.forms');
  return drupal_get_form('ssy_live_room_ssy_live_room_entity_form', $e, 'edit');
}

function ssy_live_room_ssy_live_room_delete_page(SsyLiveRoom $e) {
  module_load_include('inc', 'ssy_live_room', 'ssy_live_room.forms');
  return drupal_get_form('ssy_live_room_ssy_live_room_delete_form', $e);
}

function ssy_live_room_shusy_anchor_edit_page(ShusyAnchor $anchor) {
  $e = ssy_live_room_new_single(FALSE, ['anchor_id' => $anchor->id]);
  module_load_include('inc', 'ssy_live_room', 'ssy_live_room.forms');
  return drupal_get_form('ssy_live_room_ssy_live_room_entity_form', $e, 'add');
}
